clear
set more off

use "${raw}/May_matching/CPSMay7782.dta",clear

tostring(cluster),replace
g length=length(cluster)

replace cluster="0"+cluster if length==4
replace cluster="00"+cluster if length==3
replace cluster="000"+cluster if length==2
replace cluster="0000"+cluster if length==1
drop length

tostring(segment),replace


tostring(serial),replace
g length=length(serial)

replace serial="0"+serial if length==2
replace serial="00"+serial if length==1
drop length

g hhid=cluster+segment+serial
g length=length(hhid)
sort length
  
  
ren x14 lineno
ren x26 hhnum

ren month mis

ren educ edu
ren x66 _relhd
ren gradeat grdatn
ren female sex
	  
save "${raw}/May_matching/CPSMay7782.dta",replace
 
